package com.aya.lifecycle;

import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Service;

@Service
public class PersonLife implements SmartLifecycle {
    private Boolean running = false;

    @Override
    public void start() {
        System.out.println("PersonLife start");
        running = true;
    }

    @Override
    public void stop() {
        running = false;
    }

    @Override
    public boolean isRunning() {
        return running;
    }

    @Override
    public int getPhase() {
        return 10;
    }

    @Override
    public boolean isAutoStartup() {
        return true;
    }

    @Override
    public void stop(Runnable callback) {

    }
}
